#!/bin/sh
echo $0 $*
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

# 加载背景图片
./pic2fb loading.png

# 修改为直接获取文件夹名称的用法
ProjectName="game_name"
GAMEDIR="/mnt/SDCARD/Ports/$ProjectName"
# GAMEDIR=${PWD}
echo ==========GAMEDIR is $GAMEDIR
controlfolder="../PortMaster"

source $controlfolder/control.txt
#source $controlfolder/tasksetter

# device_info.txt根据需要是否需要注释
# CFW_NAME="TrimUI"
# DEVICE_NAME="TrimUI Smart Pro"
# DEVICE_ARCH="aarch64"
# DEVICE_CPU="a133plus"
# DEVICE_HAS_AARCH64="Y"
# DISPLAY_WIDTH=1280
# DISPLAY_HEIGHT=720

get_controls

# Enable logging
> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1
cd $GAMEDIR